package nil.ed.simulator.request.enums.events;

import lombok.AllArgsConstructor;
import lombok.Getter;
import nil.ed.common.utils.BaseEnum;
import nil.ed.common.utils.EnumUtils;

import java.util.Map;

/**
 * 事件处理模式.
 * @author lidelin.
 */
@Getter
@AllArgsConstructor
public enum EventMode implements BaseEnum<Integer> {
    /**
     * 同步事件触发.
     */
    SYNC(1, "同步"),
    ASYNC(2, "异步")
    ;

    private static final Map<Integer, EventMode> CACHE;

    private final Integer code;
    private final String desc;

    static {
        CACHE = EnumUtils.asMap(EventMode.class);
    }

}
